$OpenBSD: patch-autoconf_ast_check_raii_m4,v 1.1 2017/05/26 15:30:49 sthen Exp $

Index: autoconf/ast_check_raii.m4
--- autoconf/ast_check_raii.m4.orig
+++ autoconf/ast_check_raii.m4
@@ -37,7 +37,7 @@ AC_DEFUN([AST_CHECK_RAII], [
 				AST_CLANG_BLOCKS_LIBS=""
 				AST_CLANG_BLOCKS="-Wno-unknown-warning-option -fblocks"
 				AC_MSG_RESULT(yes)
-			elif test "`echo "int main(){return ^{return 42;}();}" | ${CC} -o /dev/null -fblocks -x c -lBlocksRuntime - 2>&1`" = ""; then
+			elif test "`echo "int main(){return ^{return 42;}();}" | ${CC} -o /dev/null -fblocks -x c ${LDFLAGS} -lBlocksRuntime - 2>&1`" = ""; then
 				AST_CLANG_BLOCKS_LIBS="-lBlocksRuntime"
 				AST_CLANG_BLOCKS="-fblocks"
 				AC_MSG_RESULT(yes)
